<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="${pageContext.request.contextPath}/img/user2-160x160.jpg" class="img-circle" alt="User Image">
            </div>
            <div class="pull-left info">
                <p>
                    <security:authentication property="principal.username"/>
                </p>
                <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
            </div>
        </div>

        <!-- /.search form -->


        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">
            <li class="header">菜单</li>

            <li id="admin-index"><a href="${pageContext.request.contextPath}/index.jsp"><i class="fa fa-dashboard"></i> <span>首页</span></a></li>

            <!-- 菜单 -->

            <li class="treeview">
                <a href="#">
                    <i class="fa fa-cube"></i> <span>系统管理</span>
                    <span class="pull-right-container">
                                <i class="fa fa-angle-left pull-right"></i>
                            </span>
                </a>
<%--                页面端权限控制，显示和隐藏--%>
                <security:authorize access="hasRole('ADMIN')">
                <ul class="treeview-menu">
                    <li id="order-manage">
                        <a href="${pageContext.request.contextPath}/users/getUsers">
                            <i class="fa fa-circle-o"></i> 用户管理
                        </a>
                    </li>

                </ul>
                </security:authorize>


                <ul class="treeview-menu">
                    <li id="order-manage2">
                        <a href="${pageContext.request.contextPath}/roles/getRoles">
                            <i class="fa fa-circle-o"></i> 角色管理
                        </a>
                    </li>

                </ul>


                <ul class="treeview-menu">
                    <li id="order-manage3">
                        <a href="${pageContext.request.contextPath}/permissions/getPermissions">
                            <i class="fa fa-circle-o"></i> 资源权限管理
                        </a>
                    </li>

                </ul>


                <ul class="treeview-menu">
                    <li id="order-manage4">
                        <a href="${pageContext.request.contextPath}/logs/getLogs">
                            <i class="fa fa-circle-o"></i> 访问日志
                        </a>
                    </li>

                </ul>

            </li>


            <li class="treeview">
                <a href="#">
                    <i class="fa fa-cube"></i> <span>基础数据</span>
                    <span class="pull-right-container">
                                <i class="fa fa-angle-left pull-right"></i>
                            </span>
                </a>

                <ul class="treeview-menu">
                    <li id="order-manage5">
                        <a href="${pageContext.request.contextPath}/product/getAllProducts">
                            <i class="fa fa-circle-o"></i> 产品管理
                        </a>
                    </li>

                </ul>


                <ul class="treeview-menu">
                    <li id="order-manage6">
                        <a href="${pageContext.request.contextPath}/orders/getOrders">
                            <i class="fa fa-circle-o"></i> 订单管理
                        </a>
                    </li>

                </ul>

            </li>

            <!-- 菜单 /-->
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>